package org.example.domain;

import io.ebean.Model;
import io.ebean.annotation.WhenCreated;
import io.ebean.annotation.WhenModified;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;
import jakarta.persistence.Version;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * Base domain object with Id, version,whenCreated,whenModified
 */

@Getter
@Setter
@MappedSuperclass
public abstract class BaseDomain extends Model {
    @Id
    Long id;
    @Version
    Long version;
    @WhenCreated
    LocalDateTime whenCreated;
    @WhenModified
    LocalDateTime whenModified;
}
